<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage="/error.jsp"%>
<%@ page import="com.fredck.FCKeditor.*" %>
<%@ page import="com.beans.log.*"%> 
<%@ page import="com.business.log.*"%>
<%@ page import="java.util.List" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%	

       response.setHeader("Pragma","No-cache");
       response.setHeader("Cache-Control","no-cache");
       response.setDateHeader("Expires",0);
	
%>
<script type="text/javascript">
function check()
{
       if(document.logform.title.value=="")
	   {
	          alert("标题不能为空");
			  document.logform.title.focus();
			  return false;
	   }
      	       
}
</script>
<head>
<% String  title="写日志"; %>
<link href="<%=request.getContextPath()%>/css/main.css" rel="stylesheet" type="text/css" />



<%@include file="header.jsp"%>
<div class="main">
  <form id="logform" name="logform" method="post" action="<%=path%>/addlog" onsubmit="return check()">
  <p>	<label>日志类型:
  	 <select name="logcategory"  > 	
  	    <option value="0" selected="selected">原创</option>
  	    <option value="1">转载</option>
  	    <option value="2">翻译</option>
      </select> </label>
	  </p>
	  <br/>
  	<p>日志分类：
	<select name="logtypeid">
	<option value="0" selected="selected">请选择分类</option>
<%			
	LogTypeBus ltb=new LogTypeBus();
		List logTypeList=ltb.getAllLogTypes(username);
		for(int i=0;i<logTypeList.size();i++) {
		LogType lt=(LogType)logTypeList.get(i);
%>
	<option value="<%=lt.getLogtypeId()%>"><%=lt.getLogtypeName()%></option>
	<%
		}
	%>
	</select>&nbsp; <a href="<%=path %>/user/addlogtype.jsp">增加分类</a>  
	</p>
	<br/>
  	<p>
    <label>标题：
    <input type="text" name="title" />
    </label>
    <p>
      <label>内容：
      <%
FCKeditor oFCKeditor ;
oFCKeditor = new FCKeditor( request, "content" ) ;
oFCKeditor.setBasePath(path+"/FCKeditor/" ) ;
oFCKeditor.setHeight( "500" ) ;
oFCKeditor.setValue("");
out.println( oFCKeditor.create() ) ;
%>
      </label>
    </p>
	<br/>
     <p>
      <label>摘要：
	  <br/>
      <textarea name="intro" cols="40" rows="3"></textarea>
      </label>
    </p>
    <br/>
     <p>
      <label>
     <input type="checkbox" name="isshow" value="1" checked="checked"/>是否显示出来
      </label>
    </p>
	     <p>
      <label>
     <input type="checkbox" name="isquote" value="1" />
     是否推荐到系统首页      </label>
    </p>
     <p>
      <label>Tag:(请增加一个或多个，用“，”分开）
     <input type="text" name="logtag" />
      </label>
    </p>
     <input type="hidden" name="logauthor" value="<%=username%>"/>
	  <input type="hidden" name="action" value="add"/>
	  <br/>
      <p>
        <label>
      <center><input type="image" src="<%=path %>/images/submit.gif" /></center>
      </label>
    </p>
    <p>&nbsp;</p>
  </form>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  
</div>
</body>
<%@include file="footer.jsp"%>
</html>
